package com.bruce.pattern.structural.adapter.objectadapter;

import lombok.extern.slf4j.Slf4j;

/**
 * Created by bruce on 2018/11/4 13:17
 */
@Slf4j
public class JsonTargetAdapter implements Target {
    XmlAdaptee xmlAdaptee = new XmlAdaptee();

    @Override
    public String json() {
        //这是xml格式字符串
        String xml = xmlAdaptee.xml();

        //逻辑处理
        log.info(xml + " 正在适配成json格式数据");

        return "我是json格式的数据";
    }
}
